<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    const SUCCESS = 'success';
    const FAIL    = 'fail';

    public function responseSuccess($msg = '操作成功',$data = '')
    {
        return response()->json(['state' => self::SUCCESS,'message' => $msg,'data' => $data],200,[],256);
    }

    public function responseFail($msg = '操作失败',$data = '')
    {
        return response()->json(['state' => self::FAIL,'message' => $msg,'data' => $data],200,[],256);
    }
}
